/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-11-14
 * Time: 10:25
 */
public class Solution {
    public int removeDuplicates(int[] nums) {
        int slow = 1;
        int fast = 0;
        for (fast = 1; fast < nums.length; fast++) {
            if (nums[fast] != nums[slow-1]) {
                nums[slow] = nums[fast];
                slow++;
            }
        }

        return slow;
    }
}
